<?php

/**
 * When using a PHP function that requires a callback, 
 * how do we pass a custom parameter to the callback?
 * 
 */
class Callback
{
    public $parameter;
 
    public function handle($matches)
    {
        return $matches[1] . ($matches[2] + $this->parameter);
    }
}
 
$instance = new Callback();
$instance->parameter = 99;
echo preg_replace_callback("|(\d{2}/\d{2}/)(\d{4})|", array($instance, 'handle'), $text);